<template>
  <div>
    <h2>子组件</h2>
    <p>{{ total }}</p>
    <button @click="cg">点击切页</button>
  </div>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 0
    }
  },
  methods: {
    cg () {
      // 事件名：current-change
      this.$emit('current-change', 2)
    }
  }
}
</script>

<style lang="less" scoped>
</style>
